<template>
    <div>

        <el-dialog
        title="修改设备"
        :visible.sync="xiugaiisshow"
        :before-close="close"
        width="40%"
        center>
        <p>机器编号:{{xgsblist.innerCode}}</p>
        <p>供货时间:{{xgsblist.createTime}}</p>
    
        <p v-if="xgsblist.type">设备类型:{{xgsblist.type.name}}</p>
        <p v-if="xgsblist.node">设备容量:{{xgsblist.node.vmCount}}</p>
        
         <el-form  ref='form'  :model='form' :rules='rules'>
    <el-form-item label="选择点位：" prop="desc">
    <el-select  placeholder="请选择" style="width:80%"  v-model='form.desc'>
      <!-- 渲染  item.policyName -->
      <el-option 
       v-for="(item,index) in shjlblist" :key="index"
      :label="item.node.name" :value="item.policyName"
     ></el-option>
    </el-select>
  </el-form-item>
  </el-form>


        <p v-if="xgsblist.node">合作商:{{xgsblist.node.ownerName}}</p>
        <p v-if="xgsblist.node">所属区域:{{xgsblist.node.region.name}}</p>
        <p v-if="xgsblist.node">设备地址:{{xgsblist.node.name}}</p>
        <span slot="footer" class="dialog-footer">
            <el-button @click='close'>取 消</el-button>
            <el-button type="primary" @click='submit'>确 定</el-button>
        </span>
        </el-dialog>

    </div>
</template>

<script>
export default {
    name: 'qeqeqe',
     props:{
    xiugaiisshow:{
      type:Boolean,
      default:true
    },
    // 修改设备  选择点位修改
    xgsblist:{
    default:()=>{}
    },
    // 渲染主页面的list
    shjlblist:{
     default:()=>[]
    },
  },

    data() {
        return {
         form:{
        desc:'',
      },
      rules:{
        desc:[
          {required:true,message:'请输入',trigger:'blur'},
        ],
      },

        };
    },

    mounted() {
        
    },

    methods: {
          close(){
      this.$emit('update:xiugaiisshow',false)
    //   this.$refs.form.resetFields()
    //   this.form={}
      // console.log(this.form,'为什么清空不生效,生效啦');
    },

    // 点击提交
    async submit(){
    //   await this.$refs.form.validate()
    //   const res=await creatorder(this.form)
    //   // console.log(res,'新增成功了吗');
    //   this.$message.success('新增成功')
    //   this.close()
      this.$emit('update:xiugaiisshow',false)
    //   this.$refs.form.reserFileds()
    //   this.form={}
    //   this.$parents.getList()
    },
    },
};
</script>

<style lang="scss" scoped>

</style>